class CreateHeaders < ActiveRecord::Migration
  def self.up
    create_table :headers do |t|
      t.string    :title
      t.string    :keywords
      t.text      :description
      
      t.string    :headerable_type, :limit=>20, :null=>false
      t.integer   :headerable_id, :null=>false
      
      t.timestamps
    end
    
    add_index :headers, [:headerable_type, :headerable_id], :name=>"fk_headerable", :uniq=>true
    
    Header.create_translation_table! :title=>:string, :keywords=>:string, :description=>:text
  end

  def self.down
    drop_table :headers
    Header.drop_translation_table!
  end
end
